<template>
	<div>
		<div id="" style="width: 100vw;text-align: left;font-size: 0.4rem;">
			<h3>{{time}}</h3>
		</div>
		<div id="" style="width: 100vw;display: flex;" @click="search">
			<div id="" style="width: 90vw;">
				<van-search v-model="value" placeholder="请输入搜索关键词" />
			</div>
			<div id="" style="width: 10vw;margin-top: -1vh;">
				<van-icon name="chat-o" size="25" />
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				value: '',
				time: '',
			}
		},
		created() {
			let date = new Date()
			let hour = date.getHours()
			if (hour > 7 && hour < 12) {
				this.time = '早上好。'
			} else if (hour >= 13 && hour < 17) {
				this.time = '下午好。'
			} else if (hour >= 17) {
				this.time = '晚上好。'
			}
		},
		methods: {
			search() {
				this.$router.push('/Search')
			}
		}
	}
</script>

<style>
</style>
